[XEN] Recompute shadows of PAE PSE l2es when needed.
authorTim Deegan <tim.deegan@xensource.com>
Fri, 29 Sep 2006 10:57:06 +0000 (11:57 +0100)
committerTim Deegan <tim.deegan@xensource.com>
Fri, 29 Sep 2006 10:57:06 +0000 (11:57 +0100)
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
xen/arch/x86/mm/shadow/multi.c

index 5b4bcdfc77fd6ef9e18c4a6393fb15cc3e003ed1..3c55062643df64cb095dd4442204a3e3ad572f12 100644 (file)
@@ -2180,7 +2180,12 @@ static shadow_l1e_t * shadow_get_and_create_l1e(struct vcpu *v,
     /* Get the l2e */
     sl2e = shadow_get_and_create_l2e(v, gw, &sl2mfn, ft);
     if ( sl2e == NULL ) return NULL;
-    if ( shadow_l2e_get_flags(*sl2e) & _PAGE_PRESENT ) 
+    /* Install the sl1 in the l2e if it wasn't there or if we need to
+     * re-do it to fix a PSE dirty bit. */
+    if ( shadow_l2e_get_flags(*sl2e) & _PAGE_PRESENT 
+         && likely(ft != ft_demand_write
+                   || (guest_l2e_get_flags(*gw->l2e) & _PAGE_DIRTY) 
+                   || !(guest_l2e_get_flags(*gw->l2e) & _PAGE_PSE)) )
     {
         *sl1mfn = shadow_l2e_get_mfn(*sl2e);
         ASSERT(valid_mfn(*sl1mfn));